/**
 * Created by zhu on 2015/12/29.
 */
$(function () {

    $('#search').on('click', function () {  //项目点击切换状态
        var temp = $("#input_search").val();

        $.post(contextPath+"/goods/searchR",{name:temp},function(data){
            var result = $('#search_result');
            var content;
            result.empty();
            $.each(data.list,function(i,item){
                var temp = '    <div class="list-block first_list"><ul> ' +
                    ' <li class="item-content "> ' +
                    '<div class="item-media"><i class="icon icon-browser"></i></div> ' +
                    ' <div class="item-inner">' +
                    ' <div class="item-title">东方连锁旗舰店</div>' +
                    '  <div class="item-after">&emsp;|&emsp;<a href="#">购买</a></div>  </div>'+
                    '</li>'+
                    '            <li class="item-content"> ' +
                    '<div style="width: 100%;height: 100px"> ' +
                    '<div class="item-goods-img">' +
                    ' <img src="'+contextPath+item.index_url+ '">' +
                    ' </div>' +
                    ' <div class="item-goods-text"> ' +
                    '<div class = "introduce">'+item.name+'</div> ' +
                    '<div class = "price"> ' +
                    '<div class = "this-price">'+item.price+'</div> ' +
                    '<div class = "this-num"><a>-</a>&emsp;1&emsp;<a>+</a></div>' +
                    ' </div> ' +
                    '</div> </div> ' +
                    '</li> </ul> </div>';
                result.append(temp);
            });
        },'json');

    });

});
